
duowei_array:     file format elf64-littleaarch64


Disassembly of section .init:

00000000004003c8 <_init>:
  4003c8:	a9bf7bfd 	stp	x29, x30, [sp, #-16]!
  4003cc:	910003fd 	mov	x29, sp
  4003d0:	9400002e 	bl	400488 <call_weak_fn>
  4003d4:	a8c17bfd 	ldp	x29, x30, [sp], #16
  4003d8:	d65f03c0 	ret

Disassembly of section .plt:

00000000004003e0 <.plt>:
  4003e0:	a9bf7bf0 	stp	x16, x30, [sp, #-16]!
  4003e4:	90000090 	adrp	x16, 410000 <__FRAME_END__+0xf734>
  4003e8:	f947fe11 	ldr	x17, [x16, #4088]
  4003ec:	913fe210 	add	x16, x16, #0xff8
  4003f0:	d61f0220 	br	x17
  4003f4:	d503201f 	nop
  4003f8:	d503201f 	nop
  4003fc:	d503201f 	nop

0000000000400400 <__libc_start_main@plt>:
  400400:	b0000090 	adrp	x16, 411000 <__libc_start_main@GLIBC_2.17>
  400404:	f9400211 	ldr	x17, [x16]
  400408:	91000210 	add	x16, x16, #0x0
  40040c:	d61f0220 	br	x17

0000000000400410 <__gmon_start__@plt>:
  400410:	b0000090 	adrp	x16, 411000 <__libc_start_main@GLIBC_2.17>
  400414:	f9400611 	ldr	x17, [x16, #8]
  400418:	91002210 	add	x16, x16, #0x8
  40041c:	d61f0220 	br	x17

0000000000400420 <abort@plt>:
  400420:	b0000090 	adrp	x16, 411000 <__libc_start_main@GLIBC_2.17>
  400424:	f9400a11 	ldr	x17, [x16, #16]
  400428:	91004210 	add	x16, x16, #0x10
  40042c:	d61f0220 	br	x17

0000000000400430 <printf@plt>:
  400430:	b0000090 	adrp	x16, 411000 <__libc_start_main@GLIBC_2.17>
  400434:	f9400e11 	ldr	x17, [x16, #24]
  400438:	91006210 	add	x16, x16, #0x18
  40043c:	d61f0220 	br	x17

Disassembly of section .text:

0000000000400440 <_start>:
  400440:	d280001d 	mov	x29, #0x0                   	// #0
  400444:	d280001e 	mov	x30, #0x0                   	// #0
  400448:	aa0003e5 	mov	x5, x0
  40044c:	f94003e1 	ldr	x1, [sp]
  400450:	910023e2 	add	x2, sp, #0x8
  400454:	910003e6 	mov	x6, sp
  400458:	580000c0 	ldr	x0, 400470 <_start+0x30>
  40045c:	580000e3 	ldr	x3, 400478 <_start+0x38>
  400460:	58000104 	ldr	x4, 400480 <_start+0x40>
  400464:	97ffffe7 	bl	400400 <__libc_start_main@plt>
  400468:	97ffffee 	bl	400420 <abort@plt>
  40046c:	00000000 	.inst	0x00000000 ; undefined
  400470:	00400590 	.word	0x00400590
  400474:	00000000 	.word	0x00000000
  400478:	004007b8 	.word	0x004007b8
  40047c:	00000000 	.word	0x00000000
  400480:	00400830 	.word	0x00400830
  400484:	00000000 	.word	0x00000000

0000000000400488 <call_weak_fn>:
  400488:	90000080 	adrp	x0, 410000 <__FRAME_END__+0xf734>
  40048c:	f947f000 	ldr	x0, [x0, #4064]
  400490:	b4000040 	cbz	x0, 400498 <call_weak_fn+0x10>
  400494:	17ffffdf 	b	400410 <__gmon_start__@plt>
  400498:	d65f03c0 	ret
  40049c:	00000000 	.inst	0x00000000 ; undefined

00000000004004a0 <deregister_tm_clones>:
  4004a0:	b0000081 	adrp	x1, 411000 <__libc_start_main@GLIBC_2.17>
  4004a4:	b0000080 	adrp	x0, 411000 <__libc_start_main@GLIBC_2.17>
  4004a8:	9100c021 	add	x1, x1, #0x30
  4004ac:	9100c000 	add	x0, x0, #0x30
  4004b0:	91001c21 	add	x1, x1, #0x7
  4004b4:	cb000021 	sub	x1, x1, x0
  4004b8:	f100383f 	cmp	x1, #0xe
  4004bc:	540000a9 	b.ls	4004d0 <deregister_tm_clones+0x30>  // b.plast
  4004c0:	580000c1 	ldr	x1, 4004d8 <deregister_tm_clones+0x38>
  4004c4:	b4000061 	cbz	x1, 4004d0 <deregister_tm_clones+0x30>
  4004c8:	d61f0020 	br	x1
  4004cc:	d503201f 	nop
  4004d0:	d65f03c0 	ret
  4004d4:	d503201f 	nop
	...

00000000004004e0 <register_tm_clones>:
  4004e0:	b0000081 	adrp	x1, 411000 <__libc_start_main@GLIBC_2.17>
  4004e4:	b0000080 	adrp	x0, 411000 <__libc_start_main@GLIBC_2.17>
  4004e8:	9100c021 	add	x1, x1, #0x30
  4004ec:	9100c000 	add	x0, x0, #0x30
  4004f0:	cb000021 	sub	x1, x1, x0
  4004f4:	9343fc21 	asr	x1, x1, #3
  4004f8:	8b41fc21 	add	x1, x1, x1, lsr #63
  4004fc:	9341fc21 	asr	x1, x1, #1
  400500:	b4000081 	cbz	x1, 400510 <register_tm_clones+0x30>
  400504:	580000a2 	ldr	x2, 400518 <register_tm_clones+0x38>
  400508:	b4000042 	cbz	x2, 400510 <register_tm_clones+0x30>
  40050c:	d61f0040 	br	x2
  400510:	d65f03c0 	ret
  400514:	d503201f 	nop
	...

0000000000400520 <__do_global_dtors_aux>:
  400520:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  400524:	910003fd 	mov	x29, sp
  400528:	f9000bf3 	str	x19, [sp, #16]
  40052c:	b0000093 	adrp	x19, 411000 <__libc_start_main@GLIBC_2.17>
  400530:	3940c260 	ldrb	w0, [x19, #48]
  400534:	35000080 	cbnz	w0, 400544 <__do_global_dtors_aux+0x24>
  400538:	97ffffda 	bl	4004a0 <deregister_tm_clones>
  40053c:	52800020 	mov	w0, #0x1                   	// #1
  400540:	3900c260 	strb	w0, [x19, #48]
  400544:	f9400bf3 	ldr	x19, [sp, #16]
  400548:	a8c27bfd 	ldp	x29, x30, [sp], #32
  40054c:	d65f03c0 	ret

0000000000400550 <frame_dummy>:
  400550:	90000080 	adrp	x0, 410000 <__FRAME_END__+0xf734>
  400554:	91380000 	add	x0, x0, #0xe00
  400558:	f9400001 	ldr	x1, [x0]
  40055c:	b5000061 	cbnz	x1, 400568 <frame_dummy+0x18>
  400560:	17ffffe0 	b	4004e0 <register_tm_clones>
  400564:	d503201f 	nop
  400568:	58000101 	ldr	x1, 400588 <frame_dummy+0x38>
  40056c:	b4ffffa1 	cbz	x1, 400560 <frame_dummy+0x10>
  400570:	a9bf7bfd 	stp	x29, x30, [sp, #-16]!
  400574:	910003fd 	mov	x29, sp
  400578:	d63f0020 	blr	x1
  40057c:	a8c17bfd 	ldp	x29, x30, [sp], #16
  400580:	17ffffd8 	b	4004e0 <register_tm_clones>
  400584:	d503201f 	nop
	...

0000000000400590 <main>:
void sum_rows(int ar[][COLS], int rows);
void sum_cols(int [][COLS], int);
int sum2d(int (*ar)[COLS], int rows);

int main(void)
{
  400590:	a9bc7bfd 	stp	x29, x30, [sp, #-64]!
  400594:	910003fd 	mov	x29, sp
	int junk[ROWS][COLS] = {
  400598:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  40059c:	9121c001 	add	x1, x0, #0x870 ; variable
  4005a0:	910043a0 	add	x0, x29, #0x10 ; stack point
  4005a4:	a9400c22 	ldp	x2, x3, [x1]   ; x2, x3 <----- x1
  4005a8:	a9000c02 	stp	x2, x3, [x0]   ; x2, x3 -----> x0
  4005ac:	a9410c22 	ldp	x2, x3, [x1, #16] ; x2, x3 <---- x1+16
  4005b0:	a9010c02 	stp	x2, x3, [x0, #16] ; x2, x3 ----> x0+16
  4005b4:	a9420821 	ldp	x1, x2, [x1, #32] ; x1, x2 <---- x1+32
  4005b8:	a9020801 	stp	x1, x2, [x0, #32] ; x1, x2 ----> x0+32
		{2, 4, 6, 8},
		{3, 5, 7, 9},
		{12, 10, 8, 6}
	};

	sum_rows(junk, ROWS);
  4005bc:	910043a0 	add	x0, x29, #0x10 ; junk address
  4005c0:	52800061 	mov	w1, #0x3                   	// #3
  4005c4:	9400000e 	bl	4005fc <sum_rows>
	sum_cols(junk, ROWS);
  4005c8:	910043a0 	add	x0, x29, #0x10 ; junk address
  4005cc:	52800061 	mov	w1, #0x3                   	// #3
  4005d0:	94000032 	bl	400698 <sum_cols>

	printf("sum of all elements = %d\n", sum2d(junk, ROWS));
  4005d4:	910043a0 	add	x0, x29, #0x10                 ; junk address
  4005d8:	52800061 	mov	w1, #0x3                   	// #3
  4005dc:	94000056 	bl	400734 <sum2d>
  4005e0:	2a0003e1 	mov	w1, w0
  4005e4:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  4005e8:	91214000 	add	x0, x0, #0x850
  4005ec:	97ffff91 	bl	400430 <printf@plt>

	return 0;
  4005f0:	52800000 	mov	w0, #0x0                   	// #0
}
  4005f4:	a8c47bfd 	ldp	x29, x30, [sp], #64
  4005f8:	d65f03c0 	ret

00000000004005fc <sum_rows>:

void sum_rows(int ar[][COLS], int rows)
{
  4005fc:	a9bd7bfd 	stp	x29, x30, [sp, #-48]!
  400600:	910003fd 	mov	x29, sp
  400604:	f9000fa0 	str	x0, [x29, #24] ; ar
  400608:	b90017a1 	str	w1, [x29, #20] ; rows
	int r;
	int c;
	int tot;

	for (r = 0; r < rows; r++) {
  40060c:	b9002fbf 	str	wzr, [x29, #44] ; r
  400610:	1400001b 	b	40067c <sum_rows+0x80>
		tot = 0;
  400614:	b90027bf 	str	wzr, [x29, #36] ; tot
		for (c = 0; c < COLS; c++) {
  400618:	b9002bbf 	str	wzr, [x29, #40] ; c
  40061c:	1400000d 	b	400650 <sum_rows+0x54>
			tot += ar[r][c];
  400620:	b9802fa0 	ldrsw	x0, [x29, #44] ; r
  400624:	d37cec00 	lsl	x0, x0, #4         ; x0 = r<<4
  400628:	f9400fa1 	ldr	x1, [x29, #24]     ; x1 = ar
  40062c:	8b000020 	add	x0, x1, x0         ; x0 = ar + r<<4
  400630:	b9802ba1 	ldrsw	x1, [x29, #40] ; x1 = c
  400634:	b8617800 	ldr	w0, [x0, x1, lsl #2] ; w0 = ar+r<<4 + c<<2
  400638:	b94027a1 	ldr	w1, [x29, #36]       ; tot
  40063c:	0b000020 	add	w0, w1, w0           ; tot + ar+r<<4+c<<2
  400640:	b90027a0 	str	w0, [x29, #36]       ; tot = tot + ar[r][c]
		for (c = 0; c < COLS; c++) {
  400644:	b9402ba0 	ldr	w0, [x29, #40] ; c
  400648:	11000400 	add	w0, w0, #0x1   ; c+1
  40064c:	b9002ba0 	str	w0, [x29, #40] ; c
  400650:	b9402ba0 	ldr	w0, [x29, #40] ; c
  400654:	71000c1f 	cmp	w0, #0x3
  400658:	54fffe4d 	b.le	400620 <sum_rows+0x24>
		}
		printf("row %d : sum = %d\n", r, tot);
  40065c:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400660:	91228000 	add	x0, x0, #0x8a0
  400664:	b94027a2 	ldr	w2, [x29, #36]
  400668:	b9402fa1 	ldr	w1, [x29, #44]
  40066c:	97ffff71 	bl	400430 <printf@plt>
	for (r = 0; r < rows; r++) {
  400670:	b9402fa0 	ldr	w0, [x29, #44]
  400674:	11000400 	add	w0, w0, #0x1
  400678:	b9002fa0 	str	w0, [x29, #44]
  40067c:	b9402fa1 	ldr	w1, [x29, #44]
  400680:	b94017a0 	ldr	w0, [x29, #20]
  400684:	6b00003f 	cmp	w1, w0
  400688:	54fffc6b 	b.lt	400614 <sum_rows+0x18>  // b.tstop
	}
}
  40068c:	d503201f 	nop
  400690:	a8c37bfd 	ldp	x29, x30, [sp], #48
  400694:	d65f03c0 	ret

0000000000400698 <sum_cols>:

void sum_cols(int ar[][COLS], int rows)
{
  400698:	a9bd7bfd 	stp	x29, x30, [sp, #-48]!
  40069c:	910003fd 	mov	x29, sp
  4006a0:	f9000fa0 	str	x0, [x29, #24]
  4006a4:	b90017a1 	str	w1, [x29, #20]
	int r;
	int c;
	int tot;

	for (c = 0; c < COLS; c++) {
  4006a8:	b9002bbf 	str	wzr, [x29, #40]
  4006ac:	1400001c 	b	40071c <sum_cols+0x84>
		tot = 0;
  4006b0:	b90027bf 	str	wzr, [x29, #36]
		for (r = 0; r < rows; r++)
  4006b4:	b9002fbf 	str	wzr, [x29, #44]
  4006b8:	1400000d 	b	4006ec <sum_cols+0x54>
			tot += ar[r][c];
  4006bc:	b9802fa0 	ldrsw	x0, [x29, #44]
  4006c0:	d37cec00 	lsl	x0, x0, #4
  4006c4:	f9400fa1 	ldr	x1, [x29, #24]
  4006c8:	8b000020 	add	x0, x1, x0
  4006cc:	b9802ba1 	ldrsw	x1, [x29, #40]
  4006d0:	b8617800 	ldr	w0, [x0, x1, lsl #2]
  4006d4:	b94027a1 	ldr	w1, [x29, #36]
  4006d8:	0b000020 	add	w0, w1, w0
  4006dc:	b90027a0 	str	w0, [x29, #36]
		for (r = 0; r < rows; r++)
  4006e0:	b9402fa0 	ldr	w0, [x29, #44]
  4006e4:	11000400 	add	w0, w0, #0x1
  4006e8:	b9002fa0 	str	w0, [x29, #44]
  4006ec:	b9402fa1 	ldr	w1, [x29, #44]
  4006f0:	b94017a0 	ldr	w0, [x29, #20]
  4006f4:	6b00003f 	cmp	w1, w0
  4006f8:	54fffe2b 	b.lt	4006bc <sum_cols+0x24>  // b.tstop
		printf("col %d : sum = %d\n", c, tot);
  4006fc:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400700:	9122e000 	add	x0, x0, #0x8b8
  400704:	b94027a2 	ldr	w2, [x29, #36]
  400708:	b9402ba1 	ldr	w1, [x29, #40]
  40070c:	97ffff49 	bl	400430 <printf@plt>
	for (c = 0; c < COLS; c++) {
  400710:	b9402ba0 	ldr	w0, [x29, #40]
  400714:	11000400 	add	w0, w0, #0x1
  400718:	b9002ba0 	str	w0, [x29, #40]
  40071c:	b9402ba0 	ldr	w0, [x29, #40]
  400720:	71000c1f 	cmp	w0, #0x3
  400724:	54fffc6d 	b.le	4006b0 <sum_cols+0x18>
	}
}
  400728:	d503201f 	nop
  40072c:	a8c37bfd 	ldp	x29, x30, [sp], #48
  400730:	d65f03c0 	ret

0000000000400734 <sum2d>:

int sum2d(int (*ar)[COLS], int rows)
{
  400734:	d10083ff 	sub	sp, sp, #0x20
  400738:	f90007e0 	str	x0, [sp, #8]
  40073c:	b90007e1 	str	w1, [sp, #4]
	int r;
	int c;
	int tot = 0;
  400740:	b90017ff 	str	wzr, [sp, #20] ; tot

	for (r = 0; r < rows; r++) {
  400744:	b9001fff 	str	wzr, [sp, #28] ; r
  400748:	14000015 	b	40079c <sum2d+0x68>
		for (c = 0; c < COLS; c++)
  40074c:	b9001bff 	str	wzr, [sp, #24] ; c
  400750:	1400000d 	b	400784 <sum2d+0x50>
			tot += ar[r][c];
  400754:	b9801fe0 	ldrsw	x0, [sp, #28] ; r
  400758:	d37cec00 	lsl	x0, x0, #4        ; x0 = r<<4
  40075c:	f94007e1 	ldr	x1, [sp, #8]      ; x1 = sp+8
  400760:	8b000020 	add	x0, x1, x0        ; x0 = sp+8 + r<<4
  400764:	b9801be1 	ldrsw	x1, [sp, #24] ; c
  400768:	b8617800 	ldr	w0, [x0, x1, lsl #2] ; w0 = (sp+8) + (sp+8)<<2
  40076c:	b94017e1 	ldr	w1, [sp, #20]        ; tot
  400770:	0b000020 	add	w0, w1, w0
  400774:	b90017e0 	str	w0, [sp, #20]
		for (c = 0; c < COLS; c++)
  400778:	b9401be0 	ldr	w0, [sp, #24] ; c
  40077c:	11000400 	add	w0, w0, #0x1  ; c + 1
  400780:	b9001be0 	str	w0, [sp, #24] ; c
  400784:	b9401be0 	ldr	w0, [sp, #24] ; c
  400788:	71000c1f 	cmp	w0, #0x3
  40078c:	54fffe4d 	b.le	400754 <sum2d+0x20>
	for (r = 0; r < rows; r++) {
  400790:	b9401fe0 	ldr	w0, [sp, #28]
  400794:	11000400 	add	w0, w0, #0x1
  400798:	b9001fe0 	str	w0, [sp, #28]
  40079c:	b9401fe1 	ldr	w1, [sp, #28]
  4007a0:	b94007e0 	ldr	w0, [sp, #4]
  4007a4:	6b00003f 	cmp	w1, w0
  4007a8:	54fffd2b 	b.lt	40074c <sum2d+0x18>  // b.tstop
	}

	return tot;
  4007ac:	b94017e0 	ldr	w0, [sp, #20]
}
  4007b0:	910083ff 	add	sp, sp, #0x20
  4007b4:	d65f03c0 	ret

00000000004007b8 <__libc_csu_init>:
  4007b8:	a9bc7bfd 	stp	x29, x30, [sp, #-64]!
  4007bc:	910003fd 	mov	x29, sp
  4007c0:	a9025bf5 	stp	x21, x22, [sp, #32]
  4007c4:	90000095 	adrp	x21, 410000 <__FRAME_END__+0xf734>
  4007c8:	a90153f3 	stp	x19, x20, [sp, #16]
  4007cc:	90000094 	adrp	x20, 410000 <__FRAME_END__+0xf734>
  4007d0:	9137c2b5 	add	x21, x21, #0xdf0
  4007d4:	9137e294 	add	x20, x20, #0xdf8
  4007d8:	cb150294 	sub	x20, x20, x21
  4007dc:	a90363f7 	stp	x23, x24, [sp, #48]
  4007e0:	aa0203f6 	mov	x22, x2
  4007e4:	2a0003f8 	mov	w24, w0
  4007e8:	aa0103f7 	mov	x23, x1
  4007ec:	97fffef7 	bl	4003c8 <_init>
  4007f0:	9343fe94 	asr	x20, x20, #3
  4007f4:	b4000154 	cbz	x20, 40081c <__libc_csu_init+0x64>
  4007f8:	d2800013 	mov	x19, #0x0                   	// #0
  4007fc:	f8737aa3 	ldr	x3, [x21, x19, lsl #3]
  400800:	aa1603e2 	mov	x2, x22
  400804:	aa1703e1 	mov	x1, x23
  400808:	2a1803e0 	mov	w0, w24
  40080c:	91000673 	add	x19, x19, #0x1
  400810:	d63f0060 	blr	x3
  400814:	eb13029f 	cmp	x20, x19
  400818:	54ffff21 	b.ne	4007fc <__libc_csu_init+0x44>  // b.any
  40081c:	a94153f3 	ldp	x19, x20, [sp, #16]
  400820:	a9425bf5 	ldp	x21, x22, [sp, #32]
  400824:	a94363f7 	ldp	x23, x24, [sp, #48]
  400828:	a8c47bfd 	ldp	x29, x30, [sp], #64
  40082c:	d65f03c0 	ret

0000000000400830 <__libc_csu_fini>:
  400830:	d65f03c0 	ret

Disassembly of section .fini:

0000000000400834 <_fini>:
  400834:	a9bf7bfd 	stp	x29, x30, [sp, #-16]!
  400838:	910003fd 	mov	x29, sp
  40083c:	a8c17bfd 	ldp	x29, x30, [sp], #16
  400840:	d65f03c0 	ret
